theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE)+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1970)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(aes(x = gini_mkt, y = v2x_polyarchy), method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
geom_smooth(aes(x = gini_mkt, y = v2x_polyarchy), method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black") +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1970)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = TRUE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1970)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = TRUE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1970 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1970)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1980 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1980)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot1980 <- plot1980 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "GDP per capita log",
title = "1980",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1980
plot1980 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1980)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot1980 <- plot1980 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "1980",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1980
plot2000<- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==2000)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot2000<- plot2000 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "2000",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot2000
inequality_data  <- inequality_data  %>%
filter(year==1970 | year==1960 | year==1980 | year==2000 | year==2010)
inequality_data  <- inequality_data  %>%
filter(year==1970 | year==1960 | year==1980 | year==2000 | year==2010)
plot2010<- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==2010)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot2010<- plot2010 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "2010",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot2010
inequality_data  <- inequality_data  %>%
filter(year==1970 | year==1960 | year==1980 | year==2000 | year==2010)
plot2010<- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==2010)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot2010<- plot2010 +
geom_point(aes(colour = factor(v2x_regime), size = e_mipopula_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "2010",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot2010
plot2010<- plot2010 +
geom_point(aes(colour = factor(v2x_regime), size = e_mipopula_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "2010",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot2010
plot2010<- plot2010 +
geom_point(aes(colour = factor(v2x_regime)), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "2010",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot2010
plot2010<- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==2010)%>%
ggplot(aes(x = gini_mkt, y = v2x_polyarchy))
plot2010<- plot2010 +
geom_point(aes(colour = factor(v2x_regime)), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "2010",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot2010
grid.arrange(plot1970, plot1980, plot2000, nrow = 2)
plot1970 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1970)%>%
ggplot(aes(x = v2x_polyarchy, y = gini_mkt))
plot1970 <- plot1970 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "1970",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1970
plot1980 <- inequality_data  %>%
mutate(e_mipopula_ln = log(e_mipopula),
e_wb_pop_ln = log(e_wb_pop)) %>%
filter(year==1980)%>%
ggplot(aes(x = v2x_polyarchy, y = gini_mkt))
plot1980 <- plot1980 +
geom_point(aes(colour = factor(v2x_regime), size = e_wb_pop_ln), alpha = .5) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
labs(colour = "Regime Type", size = "Size of Population (log)") +
geom_smooth(method = lm, formula = y ~ splines::bs(x, 3), se = FALSE, colour = "black")+
theme_bw()+
labs(y = "Electoral Democracy",
color = "", x = "Market Inequality (GINI)",
title = "1980",
subtitle = "Correlation between Inequality and Electoral Democracy",
caption = "Data from Solt 2019 and V-Dem dataset, version 9")
plot1980
inequality_data <- vdem %>%
select(country_name,country_id, year, country_text_id, v2x_polyarchy,
e_migdppcln, e_migdppc, e_migdpgro, e_mipopula, e_miurbpop, e_wb_pop, v2x_regime,
gini_disp, gini_mkt)
inequality_data  <- inequality_data  %>%
filter(year>1960)
violin_plot <- ggplot(inequality_data,
aes(x = as.factor(v2x_regime), y = gini_mkt))
violin_plot +
geom_violin(adjust = 2, trim = TRUE) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
inequality_data <- vdem %>%
select(country_name,country_id, year, country_text_id, v2x_polyarchy,
e_migdppcln, e_migdppc, e_migdpgro, e_mipopula, e_miurbpop, e_wb_pop, v2x_regime,
gini_disp, gini_mkt)
inequality_data  <- inequality_data  %>%
filter(year>1960) %>%
drop_na(v2x_regime)
violin_plot <- ggplot(inequality_data,
aes(x = as.factor(v2x_regime), y = gini_mkt))
violin_plot +
geom_violin(adjust = 2, trim = TRUE) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot +
geom_violin(adjust = 1, trim = FALSE, colour= v2x_regime) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot <- ggplot(inequality_data,
aes(x = as.factor(v2x_regime), y = gini_mkt))
violin_plot +
geom_violin(adjust = 1, trim = FALSE, colour = as.factor(v2x_regime)) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot +
geom_violin(adjust = 1, trim = FALSE, fill = v2x_regime) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot <- ggplot(inequality_data,
aes(x = as.factor(v2x_regime), y = gini_mkt, colour=v2x_regime))
violin_plot +
geom_violin(adjust = 1, trim = FALSE, colour = v2x_regime) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot <- ggplot(inequality_data,
aes(x = as.factor(v2x_regime), y = gini_mkt, colour=v2x_regime))
violin_plot +
geom_violin(adjust = 1, trim = FALSE) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot <- ggplot(inequality_data,
aes(x = as.factor(v2x_regime), y = gini_mkt, fill = as.factor(v2x_regime)))
violin_plot +
geom_violin(adjust = 1, trim = FALSE) +
geom_boxplot(width = .1, fill = "black", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot +
geom_violin(adjust = 1, trim = TRUE) +
geom_boxplot(width = .1, fill = "white", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot +
geom_violin(adjust = 1, trim = TRUE) +
scale_colour_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
geom_boxplot(width = .1, fill = "white", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot +
geom_violin(adjust = 1, trim = TRUE) +
scale_fill_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
geom_boxplot(width = .1, fill = "white", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot +
geom_violin(adjust = 1, trim = TRUE) +
scale_y_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
geom_boxplot(width = .1, fill = "white", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot <- ggplot(inequality_data,
aes(x = as.factor(v2x_regime), y = gini_mkt, fill = as.factor(v2x_regime)))
violin_plot +
geom_violin(adjust = 1, trim = TRUE) +
scale_y_continuous(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
geom_boxplot(width = .1, fill = "white", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
violin_plot +
geom_violin(adjust = 1, trim = TRUE) +
scale_y_discrete(labels = c("Closed Autocracy", "Electoral Autocracy", "Electoral Democracy", "Liberal Democracy")) +
geom_boxplot(width = .1, fill = "white", outlier.colour = NA) +
stat_summary(fun.y = median, geom = "point", fill = "white", shape = 21, size = 2.5)+
theme_bw()+
scale_fill_viridis_d()+
guides(fill = guide_legend(title = NULL))+
labs(y = "Demand for more income equality",
x = "Income quintiles",
title = "Demand for more  income equality by income quintiles",
caption = "Data from World Value Survey and V-Dem dataset, version 9")
